{include file='common/head' /}
    <body>
        <!--说明栏目-->
        <div class="x-nav">
              <span class="layui-breadcrumb">
                  <a><cite>订单管理</cite></a>
                  <a><cite>运费设置</cite></a>
              </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <!--主体开始-->
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <!--按钮和功能-->
                        <div class="layui-card-header">
                            <button class="layui-btn" onclick="xadmin.open('添加轮播图','/admin/services/freightEdit',800,600)"><i class="layui-icon"></i>添加</button>
                            <span style="line-height:40px;float: right;">共有数据：{$count} 条</span>
                        </div>
                        <!--表格数据展示-->
                        <div class="layui-card-body layui-table-body layui-table-main">
                            <table class="layui-table layui-form">
                                <thead>
                                <tr>
                                    <th style="text-align: center;">名称</th>
                                    <th style="text-align: center;">详情</th>
                                    <th style="text-align: center;">排序</th>
                                    <th style="text-align: center;">类型</th>
                                    <th style="text-align: center;">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="list" id="v"}
                                <tr>
                                    <td style="text-align: center;">{$v.name}</td>
                                    <td style="text-align: center;" class="table-number">
                                        <p>首{$configTyepStr[$v.type][1]}：<span>{$v.company}</span>{$configTyepStr[$v.type][0]}</p>
                                        <p>首费：<span>{$v.renew}</span>元</p>
                                        <p>续{$configTyepStr[$v.type][0]}：<span>{$v.downpayment}</span>{$configTyepStr[$v.type][0]}</p>
                                        <p>续费：<span>{$v.company}</span>元</p>
                                    </td>
                                    <td style="text-align: center;">
                                        <button class="layui-btn layui-btn layui-btn-xs layui-btn-normal" title="{$v.type}">{$v.type}</button>
                                    </td>
                                    <td style="text-align: center;">{$v.sort}</td>
                                    <td style="text-align: center;" class="td-manage">
                                        <button class="layui-btn layui-btn layui-btn-xs" title="编辑"  onclick="xadmin.open('编辑','/admin/services/freightEdit?id={$v.id}',800,600)" href="javascript:;">
                                            <i class="layui-icon">&#xe642;</i>编辑
                                        </button>
                                        <button class="layui-btn-danger layui-btn layui-btn-xs" title="删除" onclick="member_del(this,{$v['id']})" href="javascript:;">
                                            <i class="layui-icon">&#xe640;</i>删除
                                        </button>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </body>
<style>
    .table-number  span
    {
        color: #FF5722;
    }
</style>
<script>
    // 请求地址前缀
    var url_prefix = '/admin/setting/bannerHome'

    /*删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',{icon: 8,title: '提示'},function(index){
            var ids = [];
            ids.push(id);
            $.ajax({
                url:"{:url('/admin/services/freightDel')}",
                type: "post",
                data:{id:ids},
                dataType:"json",
                success:function (res) {
                    if(res.code == 200){
                        layer.msg('删除成功', {icon: 1,time:1000});
                        $(obj).parents("tr").remove();
                    }else{
                        layer.alert(res.msg, {icon:2,time:1000});
                    }
                },
                error:function(e){
                    layer.alert("网络错误", {icon:5,time:1000});
                },
            });
        },function(){
            layer.msg('取消成功', {icon: 6,time:1000});
        });
    }
</script>
{include file='common/footer' /}